package com.slkj.shilixiaoyuanapp.ui.parent.tool.activities;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.example.api.InjectParam;
import com.slkj.shilixiaoyuanapp.R;
import com.slkj.shilixiaoyuanapp.base.ActivityInfo;
import com.slkj.shilixiaoyuanapp.base.BaseActivity;
import com.slkj.shilixiaoyuanapp.entity.parent.SchoolActivitysDetailEntity;
import com.slkj.shilixiaoyuanapp.ui.common.ChosePeopleActivity;
import com.slkj.shilixiaoyuanapp.ui.common.adapter.ChosePicAdapter;
import com.slkj.shilixiaoyuanapp.view.NumberEditText;

import butterknife.BindView;

import static com.slkj.shilixiaoyuanapp.entity.code.UiCode.CHOSE_PIC_SPAN_COUNT;

@ActivityInfo(layout = R.layout.activity_activitys_passed,title = "已通过")
public class ActivitysPassedActivity extends BaseActivity {
    @InjectParam
    int id;
    @InjectParam
    SchoolActivitysDetailEntity data;
    @BindView(R.id.tv_student_name)
    TextView tv_student_name;
    @BindView(R.id.tv_actName)
    TextView tv_actName;
    @BindView(R.id.tv_actAddress)
    TextView tv_actAddress;
    @BindView(R.id.tv_actLong)
    TextView tv_actLong;
    @BindView(R.id.tv_actTime)
    TextView tv_actTime;
    @BindView(R.id.tv_actType)
    TextView tv_actType;
    @BindView(R.id.edit_content)
    NumberEditText edit_content;
    @BindView(R.id.recyc_pic)
    RecyclerView recyc_pic;
    @BindView(R.id.tv_spr)
    TextView tv_spr;
    ChosePicAdapter adapter;
    @BindView(R.id.tv_comment)
    TextView tv_comment;
    @Override
    protected void init() {
        ActivitysPassedActivity__JumpCenter.bind(this);
        tv_student_name.setText(data.getStudentName());
        tv_actName.setText(data.getTitle());
        tv_actAddress.setText(data.getAddress());
        tv_actTime.setText(data.getActivityTime());
        tv_actType.setText(data.getType());
        edit_content.setText(data.getSummary());
        tv_comment.setText(data.getComment());
        tv_actLong.setText(data.getHours()+"");
        if (data.getImage()!= null && !data.getImage().isEmpty()){
            recyc_pic.setLayoutManager(new GridLayoutManager(this, CHOSE_PIC_SPAN_COUNT));
            adapter = new ChosePicAdapter(data.getImage(), this,false);
            recyc_pic.setAdapter(adapter);
        }
        tv_spr.setText(ChosePeopleActivity.getPeoplesInfos3(data.getAuditors()));
    }
}
